package 选课系统;

import java.io.FileWriter;
import java.io.IOException;


public class Testcourse {
	public static void main(String[] args) throws IOException{
		Student stu1 = new Student("S1","张三","男");
		Student stu2 = new Student("S2","李四","女");
		Student stu3 = new Student("S3","王五","男");
		Teacher teacher1 = new Teacher("T1","赵老师","男");
		Teacher teacher2 = new Teacher("T2","杨老师","女");
		Teacher teacher3 = new Teacher("T2","张老师","女");
		Course cour1 = new Course("C1","高数","教101","8:00-9:40",teacher1);
		Course cour2 = new Course("C2","线代","教202","13:30-15:10",teacher2);
		Course cour3 = new Course("C3","物理","教303","10:00-11:40",teacher3);
		stu1.addCourse(cour1);
		stu2.addCourse(cour2);
		stu3.addCourse(cour2);
		stu3.addCourse(cour3);
		cour1.displayStudent();
		cour2.displayStudent();
		cour3.displayStudent();
		stu2.displayCourse();
		System.out.println(cour2.course_id+" "+cour2.course_name+" "+cour2.course_where+" "+cour2.course_time+" "+cour2.teacher.name);
	
	
		FileWriter f = new FileWriter("d://Java文件储存/wenben.txt");
		
			f.append(stu1.name+"的课表为：\n");
			f.append(cour1.course_id+"  "+cour1.course_name+"  "+cour1.course_where+"  "+cour1.course_time+"  "+cour1.teacher);
			//f.flush();
	        f.close();
	        System.out.println("课表储存运行完毕");
		
	}
}

